//
//  BaseTableViewController+Refresh.m
//  HappyRent
//
//  Created by CoderYee on 2017/3/28.
//  Copyright © 2017年 内圈科技. All rights reserved.
//

#import "BaseTableViewController+Refresh.h"
#import "YeeRefreshHeader.h"
@implementation BaseTableViewController (Refresh)
#pragma mark --头部刷新
-(void)tablePullupHeaderRefresh:(void (^)(void))headerBlock
{
    __weak typeof(self)weakself=self;
    YeeRefreshHeader  *headerView=[YeeRefreshHeader  headerWithRefreshingBlock:^{
        if (headerBlock)
        {
            headerBlock();
        }
    }];
    weakself.tableView.mj_header=headerView;
}
#pragma mark --尾部刷新
-(void)tablePullDownFootRefresh:(void (^)(void))footerBlock
{
    __weak typeof(self)weakself=self;
    MJRefreshBackStateFooter  *footrefreshView=[MJRefreshBackStateFooter  footerWithRefreshingBlock:^{
        if (footerBlock)
        {
            footerBlock();
        }
    }];
    weakself.tableView.mj_footer=footrefreshView;
}
#pragma mark --停止刷新
-(void)tableViewEndRefresh
{
    [self.tableView.mj_footer endRefreshing];
    [self.tableView.mj_header endRefreshing];
   // [self.tableView plc_reloadData];
}
@end
